package com.atguigu.lease.common.utils;

import org.springframework.stereotype.Component;

import java.util.Random;

@Component
public class VerifyCodeUtil {

    //获得验证码
    public static String getVerifyCode(int length){
        StringBuilder str =new StringBuilder();
        for (int i = 0; i <length ; i++) {
            int num  = new Random().nextInt(10);
            str.append(num);
        }


        return str.toString();
    }

   /* public static void main(String[] args) {
        System.out.println(getVerifyCode(4));
    }*/

}
